/**
 * @author nttdocomo
 */
define(function(require) {
	require("component");
	aries.klass("aries.panel.Tool", aries.Component.extend({

		baseCls : aries.baseCSSPrefix + 'tool',
		disabledCls : aries.baseCSSPrefix + 'tool-disabled',
		toolPressedCls : aries.baseCSSPrefix + 'tool-pressed',
		toolOverCls : aries.baseCSSPrefix + 'tool-over',
		ariaRole : 'button',

		childEls : ['toolEl'],

		renderTpl : ['<img id="{id}-toolEl" src="{blank}" class="{baseCls}-{type}" role="presentation"/>'].join(""),

		//<debug>
		_toolTypes : {
			close : 1,
			collapse : 1,
			down : 1,
			expand : 1,
			gear : 1,
			help : 1,
			left : 1,
			maximize : 1,
			minimize : 1,
			minus : 1,
			//move:1,
			next : 1,
			pin : 1,
			plus : 1,
			prev : 1,
			print : 1,
			refresh : 1,
			//resize:1,
			restore : 1,
			right : 1,
			save : 1,
			search : 1,
			toggle : 1,
			unpin : 1,
			up : 1
		},
		//</debug>
		initComponent : function() {
			var me = this;

			//<debug>
			if (me.id && me._toolTypes[me.id] && Ext.global.console) {
				Ext.global.console.warn('When specifying a tool you should use the type option, the id can conflict now that tool is a Component');
			}
			//</debug>

			me.type = me.type || me.id;

			_.extend(me.renderData, {
				baseCls : me.baseCls,
				blank : aries.BLANK_IMAGE_URL,
				type : me.type
			});

			// alias qtip, should use tooltip since it's what we have in the docs
			me.tooltip = me.tooltip || me.qtip;
			aries.Component.prototype.initComponent.apply(this,arguments);
			/*me.on({
				element : 'toolEl',
				click : me.onClick,
				mousedown : me.onMouseDown,
				mouseover : me.onMouseOver,
				mouseout : me.onMouseOut,
				scope : me
			});*/
		}
	}))
})
